package beusoft.ccjk.com.apt.util;

import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.Element;
import javax.tools.Diagnostic;

/**
 * Created by CCJK on 2018/11/24.
 */

public class LogUtil {

    public static void note(ProcessingEnvironment processingEnvironment,  String message, Object... args){
        note(processingEnvironment,null,message,args);
    }

    public static void note(ProcessingEnvironment processingEnvironment, Element element, String message, Object... args) {
        if (args.length > 0) {
            message = String.format(message, args);
        }
        if(element==null){
            processingEnvironment.getMessager().printMessage(Diagnostic.Kind.NOTE, message);
        }else{
            processingEnvironment.getMessager().printMessage(Diagnostic.Kind.NOTE, message, element);
        }
    }
}
